package com.experiment;

import cn.gdpu.oneSunFinger;
import cn.gdpu.sixPulseSowrd;
import cn.gdpu.surDragonPalm;

abstract class Role {
    private long ID;
    private double bloodVolume;

    public Role(long ID, double bloodVolume) {
        this.ID = ID;
        this.bloodVolume = bloodVolume;
    }

    public long getID() {
        return ID;
    }

    public void setID(long ID) {
        this.ID = ID;
    }

    public double getBloodVolume() {
        return bloodVolume;
    }

    public void setBloodVolume(double bloodVolume) {
        this.bloodVolume = bloodVolume;
    }

    public abstract void move();
}

class DescendingDragon extends Role implements surDragonPalm {

    public DescendingDragon(long ID, double bloodVolume) {
        super(ID, bloodVolume);
    }

    @Override
    public void useSurDragonPalm() {
        System.out.println("降龙使用了降龙掌的必杀技");
    }

    @Override
    public void move() {
        System.out.println("降龙进行了移动");
    }
}

class DuanYu extends Role implements sixPulseSowrd {

    public DuanYu(long ID, double bloodVolume) {
        super(ID, bloodVolume);
    }

    @Override
    public void useSixPulseSowrd() {
        System.out.println("段誉使用了六脉剑的必杀技");
    }

    @Override
    public void move() {
        System.out.println("段誉进行了移动");
    }
}

class WangChongYang extends Role implements oneSunFinger {

    public WangChongYang(long ID, double bloodVolume) {
        super(ID, bloodVolume);
    }

    @Override
    public void move() {
        System.out.println("王重阳进行了移动");
    }

    @Override
    public void useOneSunFinger() {
        System.out.println("王重阳使用了一阳指的必杀技");
    }
}

public class Demo {
    public static void main(String[] args) {
        DescendingDragon descendingDragon = new DescendingDragon(20241031,100);
        DuanYu duanYu = new DuanYu(20150402,100);
        WangChongYang wangChongYang = new WangChongYang(20050615,100);

        System.out.println("属性的访问：");
        System.out.println("降龙的ID：" + descendingDragon.getID());
        System.out.println("段誉的ID：" + duanYu.getID());
        System.out.println("王重阳的ID：" + wangChongYang.getID());
        System.out.println();
        System.out.println("降龙的血量：" + descendingDragon.getID());
        System.out.println("段誉的血量：" + duanYu.getID());
        System.out.println("王重阳的血量：" + wangChongYang.getID());
        System.out.println();
        System.out.println("进行方法的调用：");
        descendingDragon.move();
        descendingDragon.useSurDragonPalm();
        duanYu.move();
        duanYu.useSixPulseSowrd();
        wangChongYang.move();
        wangChongYang.useOneSunFinger();
    }
}
